
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 1
 * @Author : WangRuoyu
 * @Date : 2023/5/17 15:34
 */

#include "iostream"

using namespace std;

typedef long long ll;

struct poll {
    ll x;
    ll y;
    ll label;
};

int main() {
    ll n, m;
    cin >> n >> m;
    poll polls[n];

    for (ll i = 0; i < n; ++i) {
        char ch;
        cin >> polls[i].x >> polls[i].y >> ch;
        if (ch == 'A') polls[i].label = -1;
        else polls[i].label = 1;
    }

    for (ll i = 0; i < m; ++i) {
        ll a, b, c;
        cin >> a >> b >> c;
        ll dot = 0;
        ll flag = true;
        for (ll j = 0; j < n; ++j) {
            ll tmp = (a + b * (ll) polls[j].x + c * (ll) polls[j].y) % 10000007 * polls[j].label;
            if (dot == 0) {
                dot = tmp;
            } else {
                if (tmp * dot < 1) {
                    flag = false;
                    break;
                }
            }
        }
        if (flag) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }

    return 0;
}